#ifndef CLIP_H
#define CLIP_H

#include <osg/Vec3d>
#include <osg/BoundingSphere>
#include <vector>
#include "Hud.h"

using namespace std;

class Clip {

public:
	Clip(const double clipXmin, const double clipXmax, const double clipYmin,
			const double clipYmax, const double clipZmin, const double clipZmax, HUD* hud);
	~Clip();
	bool posValid(const osg::Vec3d pos);
	void clipSwitch();
	void addBoundingSphere(const osg::BoundingSphere sphere);

private:
	double clipX[2], clipY[2], clipZ[2];
	HUD* _hud;
	bool noClip;
	osg::BoundingSphere eyeSphere;
	vector<osg::BoundingSphere> boundingSpheres;
	bool inRoom(const osg::Vec3d pos);
	bool collision(const osg::Vec3d pos);
};

#endif
